package com.wiiss.ams.util.http;

import cn.hutool.http.Method;
import cn.hutool.json.JSONObject;

import java.util.Map;

public class HttpRequest {

    private Method method;

    private String url;

    private Map<String, String> headerMap;

    private JSONObject data;

    public HttpRequest(Method method, String url, Map<String, String> headerMap, JSONObject data) {
        super();
        this.method = method;
        this.url = url;
        this.headerMap = headerMap;
        this.data = data;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Map<String, String> getHeaderMap() {
        return headerMap;
    }

    public void setHeaderMap(Map<String, String> headerMap) {
        this.headerMap = headerMap;
    }

    public JSONObject getData() {
        return data;
    }

    public void setData(JSONObject data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return method + ", " + url + ", " + new JSONObject(headerMap).toString() + ", " + data.toString();
    }

}
